<template>
  <div>今年的年龄：<input type="text" v-model.number="count" /></div>
  <div>十年后的年龄：<input type="text" v-model="newCount" /></div>
</template>

<script>
import { computed, ref } from "vue";
export default {
  name: "App",
  setup() {
    const count = ref(10);
    const newCount = computed({
      get: () => count.value + 10,
      set: (val) => {
        count.value = val - 10;
      },
    });

    return { count, newCount };
  },
};
</script>

<style>
</style>